<admintpl file="header"/>
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">
  <ul class="nav nav-tabs">
     <li><a href="{:U('amateur/index')}">比赛列表</a></li>
     <li><a href="{:U('amateur/add')}">添加比赛</a></li>
     <li class="active"><a href="{:U('amateur/old')}">比赛列表(旧)</a></li>
  </ul>
<style> 
	input .iduoxuan{ width:14px; height:20px;float: left;} 
	span .sduoxuan{ width:14px; height:14px;margin-right:30px;} 
</style>
		<form class="well form-search" method="post" action="{:U('amateur/old')}">
			<div class="search_type cc mb10">
				<div class="mb10">
					<span class="mr20">赛事类型： 
	              	<select id="province"name="typeclass" class="normal_select index_select"> 
							<option value="0">全部</option>
        		<foreach name="action" item="vo">
        			<if condition="$formpost['typeclass'] eq $vo['constid']">
	        			<option selected="selected" value="{$vo.constid}">{$vo.actionName}</option>
	        			<else />
	        			<option value="{$vo.constid}">{$vo.actionName}</option>
        			</if>
                </foreach>
	               	</select>
	               	<input type="checkbox" name="noupdate" value='0' class="iduoxuan"<if condition="$formpost['noupdate'] eq '0'">checked="checked"</if>  style="margin-top: -2px;"/>
	               	<span class="sduoxuan">未更新</span>
						开赛日期：
						<input type="text" name="start_time" value="{$formpost.start_time}" class="J_date" style="width: 80px;">-
						<input type="text" name="end_time" value="{$formpost.end_time}" class="J_date" style="width: 80px;"> &nbsp; &nbsp;
						<input type="submit" class="btn btn-primary" value="搜索" />
						<if condition="$num neq 0">
							共有 {$num} 条相关记录
						</if>
					</span>
				</div>
			</div>
		</form>
   <div class="table_list">
      <div class="p10"><div class="pages"> {$Page} </div> </div>
   <table width="100%" cellspacing="0" class="table table-hover">
        <thead>
          <tr>
            <th width="80">赛事ID</th>
            <th>赛事类型</th>
            <th>对战球队</th>
            <th width="90">比赛时间</th>
            <th width="60">比分</th>
            <th width="120">竞猜赔率</th>
            <th width="160">ID：用户昵称</th>
            <th width="60">赛事状态</th>
            <th width="120">操作</th>
          </tr>
        </thead>
        <tbody>
        <foreach name="lists" item="vo">
          <tr>
            <td>{$vo.matchconstid}</td>
            <td>{$vo.matchdesc}</td>
            <td>
        		<foreach name="teams" item="team">
								<if condition="$team['constid'] eq $vo['teamid1'] || $team['teamnumber'] eq $vo['teamid1']">
			        			{$team.teamname}({$vo.teamid1})
			        	</if>
          	</foreach>
                :
        		<foreach name="teams" item="team">
								<if condition="$team['constid'] eq $vo['teamid2'] || $team['teamnumber'] eq $vo['teamid2']">
			        			{$team.teamname} ({$vo.teamid2})
		        		</if>
            </foreach>
            </td>
            <td>{$vo.matchdatetime|substr=2,14}</td>
            <td>
				<if condition="$vo['score1'] eq ''">
					<if condition="$vo['matchdatetime'] gt $datetime">
		        		<b>未公布</b>
	        		<else />
		        		<b style="color: red;">未更新</b>
					</if>
        		<else />
        		{$vo.score1} : {$vo.score2}
        		</if>
            </td>
	            <td>
	        		<foreach name="bets" item="bet">
								<if condition="$bet['matchinfoid'] eq $vo['matchconstid']">
				        			{$bet.odds_w} : {$bet.odds_d} : {$bet.odds_l}
				        			<php>break;</php>
				        </if>
	             </foreach>
	            </td>
						<td>
        		<foreach name="users" item="user">
						<if condition="$vo['userid'] neq 0">
							<if condition="$user['id'] eq $vo['userid'] || $user['userid'] eq $vo['userid']">
							{$user.userid}：
							<if condition="$user['user_nicename'] neq ''">
			        			{$user.user_nicename}
			        		<else />
			        			{$user.user_login}
			        		</if>
		        		</if>
		        	<else />
		        		0：系统导入
		        		<php>break;</php>
	        	</if>
            </foreach>
            </td>
            <td>
				<if condition="$vo['matchdatetime'] gt $datetime">
	        		未开赛
	        	<else />
	        		已结束
				</if>
            </td>
            <td>
					<a href="{:U('amateur/edit',array('id'=>$vo['id'],'p'=>$_GET['p'],'c'=>$formpost['typeclass']))}">修改</a>
					<if condition="$roleid eq 1">
						 | <a class="J_ajax_del" href="{:U('amateur/delete',array('id'=>$vo['id']))}">删除</a>
        	</if>
					<if condition="$vo['score1'] neq ''">
						 | <a href="{:U('amateur/update',array('id'=>$vo['id']))}">更新赛况</a>
        	</if>
        		
            </td>
          </tr>
         </foreach>
        </tbody>
        <thead>
          <tr>
            <th width="80">赛事ID</th>
            <th>赛事类型</th>
            <th>对战球队</th>
            <th width="90">比赛时间</th>
            <th width="60">比分</th>
            <th width="120">竞猜赔率</th>
            <th width="160">ID：用户昵称</th>
            <th width="60">赛事状态</th>
            <th width="120">操作</th>
          </tr>
        </thead>
      </table>
      <div class="p10"><div class="pages"> {$Page} </div> </div>
   </div>
</div>
<script type="text/javascript" src="__ROOT__/statics/js/common.js"></script>
</body>
</html>